package com.yanggu.payment.entity.weixinpay.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

public class WechatAppQueryResult {

    /**
     * 应用ID
     */
    private String appId;

    /**
     * 直连商户号
     */
    @JsonProperty("mchid")
    private String mchId;

    /**
     * 商户订单号
     */
    @JsonProperty("out_trade_no")
    private String outTradeNo;

    /**
     * 微信支付订单号
     */
    @JsonProperty("transaction_id")
    private String transactionId;

    /**
     * 交易类型
     */
    @JsonProperty("trade_type")
    private String tradeType;

    /**
     * 交易状态
     */
    @JsonProperty("trade_state")
    private String tradeState;

    /**
     * 交易状态描述
     */
    @JsonProperty("trade_state_desc")
    private String tradeStateDesc;

    /**
     * 付款银行
     */
    @JsonProperty("bank_type")
    private String bankType;

    /**
     * 附加数据
     */
    private String attach;

    /**
     * 支付完成时间
     */
    private Date successTime;

    /**
     * 支付者信息
     */
    private QueryPayer payer;

    /**
     * 订单金额信息，当支付成功时返回该字段。
     */
    private QueryAmount amount;

    /**
     * 支付场景描述
     */
    @JsonProperty("scene_info")
    private QuerySceneInfo sceneInfo;

    /**
     * 优惠功能，享受优惠时返回该字段
     */
    @JsonProperty("promotion_detail")
    private List<QueryPromotionDetail> promotionDetail;

    @JsonProperty("appId")
    public String getAppId() {
        return appId;
    }

    @JsonProperty("appid")
    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getTradeState() {
        return tradeState;
    }

    public void setTradeState(String tradeState) {
        this.tradeState = tradeState;
    }

    public String getTradeStateDesc() {
        return tradeStateDesc;
    }

    public void setTradeStateDesc(String tradeStateDesc) {
        this.tradeStateDesc = tradeStateDesc;
    }

    public String getBankType() {
        return bankType;
    }

    public void setBankType(String bankType) {
        this.bankType = bankType;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    /**
     * todo 如果类序列化和反序列化的字段名不一样需要在对应的get和set方法上添加别名
     * get是序列化, set是反序列化
     *
     * @return
     */
    @JsonProperty(value = "successTime")
    public Date getSuccessTime() {
        return successTime;
    }

    @JsonProperty(value = "success_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss")
    public void setSuccessTime(Date successTime) {
        this.successTime = successTime;
    }

    public QueryPayer getPayer() {
        return payer;
    }

    public void setPayer(QueryPayer payer) {
        this.payer = payer;
    }

    public QueryAmount getAmount() {
        return amount;
    }

    public void setAmount(QueryAmount amount) {
        this.amount = amount;
    }

    public QuerySceneInfo getSceneInfo() {
        return sceneInfo;
    }

    public void setSceneInfo(QuerySceneInfo sceneInfo) {
        this.sceneInfo = sceneInfo;
    }

    public List<QueryPromotionDetail> getPromotionDetail() {
        return promotionDetail;
    }

    public void setPromotionDetail(List<QueryPromotionDetail> promotionDetail) {
        this.promotionDetail = promotionDetail;
    }
}
